(function(){
	angular.module('app').factory('shopStatDataComponentService', shopStatDataComponentService);

	shopStatDataComponentService.$inject = ['util','$q'];

	function shopStatDataComponentService(util,$q){
		return {
			getShopProductCatValue: _getShopProductCatValue,
			getShopInfo: _getShopInfo
		}

		function _getShopProductCatValue(shopUid){

			var defer = $q.defer();

			util.$get({
				url: '/marketconditions/product/getShopProductCatValue.htm',
				data:{
					uid: shopUid
				}
			}).then(function(resp){
				defer.resolve(resp.value);
			},function(err){
				defer.reject(err);
			});

			return defer.promise;
		}

		function _getShopInfo(shopUid){

			var defer = $q.defer();

			util.$get({
				url:'/marketconditions/shop/getShopByUid.htm',
				data:{
					uid: shopUid
				}
			}).then(function(resp){
				defer.resolve(resp.value);
			},function(err){
				defer.reject(err);
			});

			return defer.promise;
		}
	}
})();